package tech.aistar.mapper;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tech.aistar.entity.Manchoice;

import java.util.List;
@Repository
public interface ManChoiceMapper {
    @Select("select  *  from   manchoice")
    List<Manchoice>   findAll();

    @Select("select  man_language  from  manchoice")
    String  findmanlan();

    @Select("select man_diff  from  manchoice")
    String findmandiff();

    @Select("select * from manchoice where man_id = #{value}")
    Manchoice findById(Long id);

//    查询题目信息
    @Select("select man_id, man_stem, man_opt_a, man_opt_b, man_opt_c, man_opt_d, man_opt_e from manchoice m  join questionpaper q on m.man_id = q.que_id where q.paper_id = #{value}  and que_type =2")
    List<Manchoice> findByPaperId(Long paperId);

    //查询答案
    @Select("select man_answer from manchoice where man_id = #{value}")
    String findAnswerByid(Long id);


}
